import request from '@/utils/request'

export function leftList(query) {
  return request({
    url: '/fund/doorBind/leftList',
    method: 'get',
    params: query
  })
}

export function rightList(query) {
  return request({
    url: '/fund/doorBind/rightList',
    method: 'get',
    params: query
  })
}

// 获取小区信息
export function getAreaInfo() {
  return request({
    url: '/house/area/list1',
    method: 'get'
  })
}
// 获取小区信息
export function getAreaInfo1(areaName) {
  return request({
    url: '/house/area/list2/'+areaName,
    method: 'get'
  })
}

// 获取楼宇信息
export function getGroupInfo(areaName) {
  return request({
    url: '/house/group/getGroupInfo/'+areaName,
    method: 'get'
  })
}

// 获取单元信息
export function getUnitInfo(areaName,groupName) {
  return request({
    url: '/house/unit/getUnitInfo/'+areaName+"/"+groupName,
    method: 'get'
  })
}

// 获取户信息
export function getDoorInfo(areaName,groupName,unitName) {
  return request({
    url: '/house/door/getDoorInfo/'+areaName+"/"+groupName+"/"+unitName,
    method: 'get'
  })
}

// 修改小区管理
export function updateBind(data) {
  return request({
    url: '/fund/doorBind/updateBind/',
    method: 'put',
    data: data
  })
}

export function insertDoor(data) {
  return request({
    url: '/fund/doorBind/insertDoor',
    method: 'post',
    data: data
  })
}
